package rpc.test.provider.service.imp;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rpc.annotation.RpcService;
import rpc.common.exception.RpcException;
import rpc.test.api.DemoService;

@RpcService(interfaceClass = DemoService.class, interfaceClassName = "rpc.test.api.DemoService", version = "1.0.0", group = "binghe")
public class ProviderDemoServiceImpl implements DemoService {

    private final Logger logger = LoggerFactory.getLogger(ProviderDemoServiceImpl.class);
    @Override
    public String hello(String name) {
        logger.info("调用hello方法传入的参数为===>>>{}", name);
        if ("johnny".equals(name)){
            throw new RuntimeException("rpc provider throw exception");//?
        }
        return "hello " + name;
    }
}

